package boc.sx.gateway.service.impl;

import boc.sx.gateway.service.BaseServiceAfterReceive;
import boc.sx.gateway.service.BusinessCode;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Map;

/*
 * @author zmx
 * @date 2022/8/11 14:20
 */
@Service
@BusinessCode("HS-S2")
public class TCServiceAfterReceive implements BaseServiceAfterReceive {


    @Override
    public Object deal(Object msg) {
        Object res = msg;
        // 对数据进行封装
        if (msg instanceof JSONObject){
            ((JSONObject) res).put("do","something");
        }else if (msg instanceof String){
            JSONObject object = JSONObject.parseObject((String) msg);
            object.put("do","something");
            res = object.toJSONString();
        }
        return res;
    }


}
